<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改设备信息')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-device-edit" th:object="${sysDevice}">
            <input name="deviceId" th:field="*{deviceId}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label">时间戳：</label>
                <div class="col-sm-8">
                    <input name="deviceTimestamp" th:field="*{deviceTimestamp}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">已运行时间：</label>
                <div class="col-sm-8">
                    <input name="deviceRunTime" th:field="*{deviceRunTime}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">cpu占用率：</label>
                <div class="col-sm-8">
                    <input name="deviceCupOcRate" th:field="*{deviceCupOcRate}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">内存占用率：</label>
                <div class="col-sm-8">
                    <input name="deviceMemOcRate" th:field="*{deviceMemOcRate}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">所属组：</label>
                <div class="col-sm-8">
                    <select name="deviceGroup" class="form-control m-b" th:with="type=${@dict.getType('sys_device_group')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{deviceGroup}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">所属地区：</label>
                <div class="col-sm-8">
                    <select name="deviceArea" class="form-control m-b" th:with="type=${@dict.getType('sys_device_area')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{deviceArea}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">功能配置：</label>
                <div class="col-sm-8">
                    <select name="deviceFunctionConfguration" class="form-control m-b" th:with="type=${@dict.getType('sys_device_config')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{deviceFunctionConfguration}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">版本号：</label>
                <div class="col-sm-8">
                    <select name="deviceVersion" class="form-control m-b" th:with="type=${@dict.getType('sys_device_version')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{deviceVersion}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">状态：</label>
                <div class="col-sm-8">
                    <div class="radio-box" th:each="dict : ${@dict.getType('sys_job_status')}">
                        <input type="radio" th:id="${'deviceStatus_' + dict.dictCode}" name="deviceStatus" th:value="${dict.dictValue}" th:field="*{deviceStatus}">
                        <label th:for="${'deviceStatus_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                    </div>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "system/device";
        $("#form-device-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-device-edit').serialize());
            }
        }
    </script>
</body>
</html>